package com.slz3.business.module.memberManagement.memMember.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.memberManagement.memMember.domain.MemMember;
import com.slz3.business.module.memberManagement.memMember.domain.MemMemberCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class MemMemberResAtomic {

    static Mono<ServerResponse> add_$MemMemberUpdateLock(ServerRequest req, MemMember memMember) {
        return MemMemberResSafeValid.add(req, memMember) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemMemberResExecutor.add(req, memMember);
    }

    public static Mono<ServerResponse> delete_$MemMemberUpdateLock(ServerRequest req, MemMemberCondition memMemberCondition) {
        return MemMemberResSafeValid.delete(req, memMemberCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemMemberResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$MemMemberUpdateLock(ServerRequest req, MemMember memMember) {
        return MemMemberResSafeValid.modify(req, memMember) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemMemberResExecutor.modify(req, memMember);
    }

    static Mono<ServerResponse> info_$MemMemberUpdateLock(ServerRequest req) {
        return MemMemberResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemMemberResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$MemMemberUpdateLock(ServerRequest req, MemMemberCondition memMemberCondition) {
        return MemMemberResSafeValid.auditSubmit(req, memMemberCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemMemberResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$MemMemberUpdateLock(ServerRequest req, MemMemberCondition memMemberCondition) {
        return MemMemberResSafeValid.audit(req, memMemberCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemMemberResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$MemMemberUpdateLock(ServerRequest req, MemMemberCondition memMemberCondition) {
        return MemMemberResSafeValid.auditReject(req, memMemberCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemMemberResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$MemMemberUpdateLock(ServerRequest req, MemMemberCondition memMemberCondition) {
        return MemMemberResSafeValid.usingEnable(req, memMemberCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemMemberResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$MemMemberUpdateLock(ServerRequest req, MemMemberCondition memMemberCondition) {
        return MemMemberResSafeValid.usingDisable(req, memMemberCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemMemberResExecutor.usingDisable(req);
    }
}
